<?php

/**
 * Shop short summary.
 *
 * Shop description.
 *
 * @version 1.0
 * @author GALAXY
 */
class Shop extends Shop_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->Model('Goods_model');
    }
    public function index()
    {
        $one= $this->convertUrlQuery('material=4&material=1');
        //p($one);
        $data['discount_goods']=$this->Goods_model->get_discount_goods_limit_tow();
        $data['hot_goods']=$this->Goods_model->get_discount_goods_limit_six();
        // p($data['hot_goods']);

        $cupge=$this->input->get('page');
        $cupge=empty($cupge) || $cupge=="0"?1:$cupge;
        $pagesize=12;
        $one=$this->Goods_model->get_page($cupge,$pagesize,"*","goods","order by weight desc,goods_id desc","goods_id","where is_del=0 and is_new=1 and is_on_sale=1","");
        $this->load->library('page');
        $p=new Page();
        $data['new_goodsList']=arrayToObject($one['objlist']);
        $p->init($one['count'][0]->_count,8,$cupge,$pagesize,site_url('shop/index'));
        $data['links']=$p->showPages(1);
        //p($data['links']);1123
        $this->load->view('Pre/shop/index.html',$data);
    }

}